#ifndef __SINGLETON_H__
#define __SINGLETON_H__

#include "Header.h"
#include <assert.h>

template <typename Instance>
class Singleton
{
private:
	Singleton(const Singleton* value)
	{

	}
protected:
	Singleton();
	virtual ~Singleton();
protected:
	static Instance* m_Instance;
public:
	static Instance* GetInstance()
	{
		if (!m_Instance)
		{
			m_Instance = new Instance();
		}
		return m_Instance;
	}

	static void DestroyInstance()
	{
		if (m_Instance)
			SAFE_DELETE(m_Instance);
	}
};

template <typename Instance>
Instance* Singleton<Instance>::m_Instance = 0;

#endif